#define _CRT_SECURE_NO_WARNINGS

#include"Heap.h"

void test1(Heap* hp)
{
	int a1[] = { 3 ,4 ,5,67, 7,8, 99,0 ,1, 23 ,53,254,762,674,10001,21,4,301,326,47,2468,6,4325,2 };
	int i = 0;
	int sz = sizeof(a1) / sizeof(a1[0]);
	for (i = 0; i < sz; ++i)
	{
		HeapPush(hp, a1[i]);
	}

	//printf("%d ", HeapTop(hp));
	//HeapPop(hp);

	//printf("%d ", HeapTop(hp));
	//HeapPop(hp);
	//printf("%d ", HeapTop(hp));
	//HeapPop(hp);
	//printf("%d ", HeapTop(hp));
	//HeapPop(hp);
	//while (!HeapEmpty(hp))
	//{
	//	printf("%d ", HeapTop(hp));
	//	HeapPop(hp);
	//}

	
}




int main()
{
	//Heap* hp = HeapInit();
	//test1(hp);


	//HeapDestory(hp);
	//hp = NULL;
	int a1[] = { 3 ,4 ,5,67, 7,8, 99,0 ,1, 23 ,53,254,762,674,10001,21,4,301,326,47,2468,6,4325,2 };
	int sz = sizeof(a1) / sizeof(a1[0]);

	//HeapSort(a1, sz);
	//for (int i = 0; i < sz; ++i)
	//{
	//	printf("%d ", a1[i]);
	//}
	//printf("\n");

	PrintTopK(a1, sz, 5);
	printf("\n");

	HeapSort(a1, sz);
	for (int i = 0; i < sz; ++i)
	{
		printf("%d ", a1[i]);
	}
	printf("\n");

	return 0;
}